home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 673 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.8 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Tue, 30 Nov 93 10:57:40 +0100
  3. Message-Id: <9311300957.AA00437@issan.informatik.uni-dortmund.de>
  4. To: mint@atari.archive.umich.edu
  5. In-Reply-To: <9311300103.AA02386@hanauma.jpl.nasa.gov> (message from Howard Chu on Mon, 29 Nov 93 17:03:40 PST)
  6. Subject: Re: two bugs fixed in ramfs 1.4
  7.  
  8. Howard Chu <hyc@hanauma.jpl.nasa.gov> writes:
  9.   
  10. |>   Most of the device drivers existing for MiNT (procfs.c, shmfs.c,
  11. |>   clockdev.c) assume that Fseek(offset,handle,2) will put the pointer
  12. |>   "offset" bytes _before_ the end of the file.  Therefore, "offset" should
  13. |>   be positive.  Ramfs also follows this convention.  Minixfs probably
  14. |>   follows the opposite convention, since it works with stzip. 
  15.   
  16. |>   [ We could make the program more bomb-proof by considering only the
  17. |>   absolute magnitude of "offset"; but in ramfs you should also be able to
  18. |>   seek past the end of a file, so it's not desirable. ]
  19.  
  20. |> Well, lseek in Unix says the offset is added to the specified position
  21. |> (beginning, current, end), so this would seem to be a pervasive bug.
  22.  
  23. Yes, this is a *major* bug. Even GEMDOS gets it right :-)
  24. Everyone should apply this patch as soon as possible :-/
  25.  
  26. diff -ur orig/procfs.c ./procfs.c
  27. --- orig/procfs.c    Sat Nov 20 01:39:58 1993
  28. +++ ./procfs.c    Tue Nov 30 10:52:00 1993
  29. @@ -698,10 +698,8 @@
  30.          f->pos = where;
  31.          break;
  32.      case 1:
  33. -        f->pos += where;
  34. -        break;
  35.      case 2:
  36. -        f->pos = -where;
  37. +        f->pos += where;
  38.          break;
  39.      default:
  40.          return EINVFN;
  41. diff -ur orig/shmfs.c ./shmfs.c
  42. --- orig/shmfs.c    Fri Jun 25 23:23:36 1993
  43. +++ ./shmfs.c    Tue Nov 30 10:52:56 1993
  44. @@ -653,10 +653,8 @@
  45.          newpos = where;
  46.          break;
  47.      case 1:
  48. -        newpos = f->pos + where;
  49. -        break;
  50.      case 2:
  51. -        newpos = maxpos - where;
  52. +        newpos = f->pos + where;
  53.          break;
  54.      default:
  55.          return EINVFN;
  56.